// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using System;
using System.Linq;
using Elastic.Clients.Elasticsearch.Serialization;

namespace Elastic.Clients.Elasticsearch.IndexManagement;

[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexSettingsAnalysisConverter))]
public sealed partial class IndexSettingsAnalysis
{
#if NET7_0_OR_GREATER
	public IndexSettingsAnalysis()
	{
	}
#endif
#if !NET7_0_OR_GREATER
	public IndexSettingsAnalysis()
	{
	}
#endif
	[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
	internal IndexSettingsAnalysis(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel)
	{
		_ = sentinel;
	}

	public Elastic.Clients.Elasticsearch.Analysis.Analyzers? Analyzers { get; set; }
	public Elastic.Clients.Elasticsearch.Analysis.CharFilters? CharFilters { get; set; }
	public Elastic.Clients.Elasticsearch.Analysis.Normalizers? Normalizers { get; set; }
	public Elastic.Clients.Elasticsearch.Analysis.TokenFilters? TokenFilters { get; set; }
	public Elastic.Clients.Elasticsearch.Analysis.Tokenizers? Tokenizers { get; set; }
}

public readonly partial struct IndexSettingsAnalysisDescriptor
{
	internal Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysis Instance { get; init; }

	[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
	public IndexSettingsAnalysisDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysis instance)
	{
		Instance = instance;
	}

	[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
	public IndexSettingsAnalysisDescriptor()
	{
		Instance = new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysis(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance);
	}

	public static explicit operator Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysis instance) => new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisDescriptor(instance);
	public static implicit operator Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysis(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisDescriptor descriptor) => descriptor.Instance;

	public Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisDescriptor Analyzers(Elastic.Clients.Elasticsearch.Analysis.Analyzers? value)
	{
		Instance.Analyzers = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisDescriptor Analyzers(System.Action<Elastic.Clients.Elasticsearch.Analysis.AnalyzersDescriptor> action)
	{
		Instance.Analyzers = Elastic.Clients.Elasticsearch.Analysis.AnalyzersDescriptor.Build(action);
		return this;
	}

	public Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisDescriptor CharFilters(Elastic.Clients.Elasticsearch.Analysis.CharFilters? value)
	{
		Instance.CharFilters = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisDescriptor CharFilters(System.Action<Elastic.Clients.Elasticsearch.Analysis.CharFiltersDescriptor> action)
	{
		Instance.CharFilters = Elastic.Clients.Elasticsearch.Analysis.CharFiltersDescriptor.Build(action);
		return this;
	}

	public Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisDescriptor Normalizers(Elastic.Clients.Elasticsearch.Analysis.Normalizers? value)
	{
		Instance.Normalizers = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisDescriptor Normalizers(System.Action<Elastic.Clients.Elasticsearch.Analysis.NormalizersDescriptor> action)
	{
		Instance.Normalizers = Elastic.Clients.Elasticsearch.Analysis.NormalizersDescriptor.Build(action);
		return this;
	}

	public Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisDescriptor TokenFilters(Elastic.Clients.Elasticsearch.Analysis.TokenFilters? value)
	{
		Instance.TokenFilters = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisDescriptor TokenFilters(System.Action<Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor> action)
	{
		Instance.TokenFilters = Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor.Build(action);
		return this;
	}

	public Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisDescriptor Tokenizers(Elastic.Clients.Elasticsearch.Analysis.Tokenizers? value)
	{
		Instance.Tokenizers = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisDescriptor Tokenizers(System.Action<Elastic.Clients.Elasticsearch.Analysis.TokenizersDescriptor> action)
	{
		Instance.Tokenizers = Elastic.Clients.Elasticsearch.Analysis.TokenizersDescriptor.Build(action);
		return this;
	}

	[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
	internal static Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysis Build(System.Action<Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisDescriptor>? action)
	{
		if (action is null)
		{
			return new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysis(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance);
		}

		var builder = new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisDescriptor(new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysis(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance));
		action.Invoke(builder);
		return builder.Instance;
	}
}